<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>hhm spring首页</title>
    <link rel="stylesheet" type="text/css" href="../plugin/bootstrap/css/bootstrap.min.css"
          tppabs="css/style.css">
    <script src="../plugin/jquery/jquery.min.js"></script>
    <script src="../plugin/jquery/jquery.form.js"></script>
    <script src="../plugin/bootstrap/js/bootstrap.min.js"></script>
    <script src="../plugin/bootstrap/js/bootbox.min.js"></script>
</head>
<script>


    function sendRequest(url, data) {

        $.post(
                url,
                data,
                function (result) {
                    if (result.success) {
                        bootbox.alert(result.msg);

                    } else {
                        bootbox.alert(result.msg);

                    }
                }
        )

    }

    Security = {
        getConfig: function () {
            sendRequest("../ra/security/getConfig");
        },

        getCurrentUserSize: function () {
            sendRequest("../ra/security/getCurrentUserSize");
        },

        setConfig:function(){
            sendRequest("../ra/security/setConfig",{
                value:$("#configValue").val()
            });

        }
    }

    Quartz = {
        updateJobCron: function () {
            sendRequest("../ra/quartz/updateJobCron",
                    {
                        triggerName: 'JobTrigger1',
                        value: '每3秒'

                    }
            )


        },

        getSchedulerByName: function () {
            sendRequest("../ra/quartz/getSchedulerByName",
                    {
                        triggerName: 'JobTrigger1'


                    }
            )
            ;
        }


    }


</script>

<body>

<div class="navbar navbar-fixed-top">

</div>
<div class="container">

    <div class="row">
        <div class="span4">
            <h2>quartz定时器</h2>


            <p>
                <button class="btn btn-success btn-large" onMouseOver="$(this).tooltip('show')" data-toggle="tooltip"
                        onclick="Quartz.updateJobCron()"
                        data-placement="bottom" title="更新quartz的定时器的触发时间，你会在控制台上看到定时器的执行速度变成了3秒执行一次">修改定时时间
                </button>


                <button class="btn btn-success btn-large" onMouseOver="$(this).tooltip('show')" data-toggle="tooltip"
                        onclick="Quartz.getSchedulerByName()"
                        data-placement="bottom" title="获取quartz当前执行的定时时间">获取定时时间
                </button>
            </p>
        </div>


        <div class="span4">
            <h2>有关权限等功能</h2>


            <p>
                <button class="btn btn-success btn-large" onMouseOver="$(this).tooltip('show')" data-toggle="tooltip"
                        onclick="Security.getCurrentUserSize()"
                        data-placement="bottom" title="获取当前登陆的用户数量">获取当前登陆者数量
                </button>


                <button class="btn btn-success btn-large" onMouseOver="$(this).tooltip('show')" data-toggle="tooltip"
                        onclick="Security.getConfig()"
                        data-placement="bottom" title="获取配置">获取配置
                </button>
                <div class="input-group" style="width: 300px">
                    <input type="text" id="configValue" placeholder="配置设置"  class="form-control">
                <span class="input-group-btn">
        <button class="btn btn-default" type="button" onclick="Security.setConfig()">修改</button>
                </span>

            </div>
            </p>
        </div>


    </div>
    <hr>
    <footer>
        <p>&copy; Company 2012</p>
    </footer>
</div>


</body>
</html>